<?php
namespace Home\Widget;
use Think\Controller;
class HtmlWidget extends Controller{
	public function index($name,$template='html'){
		$map=array(
			'name'	=>	trim($name),
			'code'	=>	'html'
			);
		$module=M('Module')->where($map)->find();
		if(!$module){
			$this->show('<h1>' . L('error_not_have') . '</h1>');
		}else{
			$module=json_decode($module['setting'],true);
			$language_id=get_default_lng_id();
			$html=$module['module_description'][$language_id];
			$html['url']=U($module['link']);
			$this->assign('html',$html);
			$this->display('Widget/' . $template);
		}
	}
}